Skip to main content

mergJSONDecode

Type​

function

Summary​

The function decodes JSON to an array.

Syntax​

mergJSONDecode(<pJSON>, <pVariableName>)

Description​

The function decodes JSON to an array.

Parameters​

NameTypeDescription

pJSON

string

The UTF8 encoded JSON to decode.

pVariableName

string

The name of the variable to decode the JSON into.

Examples​

function JSONToArray pJSON
local tArray,tKeys
repeat for each line tKey in mergJSONDecode(pJSON,"tArray")
put JSONToArray(tArray[tKey]) into tArray[tKey]
end repeat
return tArray
end JSONToArray

Value​

NameTypeDescription

return

A list of array keys that must be further decoded. As the externals interface can not deal with multi-dimensional arrays a recursive function must be used to decode deeply nested JSON.

Compatibility and Support​

Introduced

LiveCode 8.0

OS

ios

android

linux

mac

windows

Platforms

mobile

desktop

server

Thank you for your feedback!

Was this page helpful?